<?php

namespace app\common\model;
use think\Model;

class BisAccount extends BaseModel
{
    public function updateById($data, $id) {
        // allowField 过滤data数组中非数据表中的数据
        return $this->allowField(true)->save($data, ['id'=>$id]);
    }

    public function getBisAccountsByStaus($status)
    {
        $data=[
            'status' =>$status,
        ];

        $order=[
            'id' =>'desc',
        ];
        $result = $this->where($data)->order($order)
            ->paginate();
        return $result;
    }

    public function getBisAccountsByBisIdStaus($bisid,$status)
    {
        $data=[
            'bis_id' =>$bisid,
            'status' =>$status,
        ];

        $result = $this->where($data)
            ->paginate();
        return $result;
    }
}